#!/usr/bin/env python3
# -*- coding: utf-8 -*-

## 图1.2: 看涨期权的内在价值
import numpy as np
import matplotlib.pyplot as plt
StockPrice=np.linspace(0,100,100)
X=60
CallInnerValue = StockPrice-X
CallInnerValue[CallInnerValue<0] = 0

fig=plt.figure()
ax=fig.add_subplot(111)
ax.plot(StockPrice,CallInnerValue)
ax.axis('equal')
ax.set_xlabel('Stock Price')
ax.set_ylabel('Call Option Inner Value')
fig.savefig('fig1-2-a.png')






